﻿@using PracticeSimple.Models
@using BusinessObjects;
@model PatientModel


@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Scripts/Patient.js"></script>

<input type="hidden" id="hdnPatientID" value="@Model.patient.PatientID" />

<h2>Patient Details for @Model.patient.LName, @Model.patient.FName</h2>


<h4>Patient Insurance</h4>
<table id="tblInsurance">
    <thead><tr><th>Insurance Name</th><th>Policy Number</th></tr></thead>
    <tbody>
        @if(Model.patientInsurance != null)
        {
            foreach (PatientInsurance pi in Model.patientInsurance)
            {
                <tr data-patientinsuranceid="@pi.PatientInsuranceID"><td>@pi.InsuranceName</td><td>@pi.PolicyNumber</td></tr>
            }
        }
    </tbody>
</table>
<a href="#modalAddInsurance" role="button" class="btn btn-primary btn-small" data-toggle="modal">Add Insurance</a>

<h4>Patient Encounters</h4>
<table>
    <thead><tr><th>Encounter Date</th></tr></thead>
<tbody>
@foreach (Encounter e in Model.encounters)
{
 <tr><td><a class='btn btn-primary btn-mini lnkViewPatient' href='Encounter?id=@e.EncounterID'>View Encounter</a></td><td>@e.EncounterDate</td></tr>


}
</tbody>
</table>

 
<div id="modalAddInsurance" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Add Insurance</h3>
  </div>
  <div class="modal-body">
    @Html.Partial("AddInsurance");
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <button class="btn btn-primary" id="btnSaveInsurance">Save</button>
  </div>
</div>